//
// Created by 29787 on 2023/12/26.
//
#ifndef ENCODER_UPRE_DECISION_H
#define ENCODER_UPRE_DECISION_H
#include "stm32f429xx.h"
#include "stdbool.h"
#define null        0
#define left_vent   101
#define right_vent  102
#define blue_ball   103
#define purplr_ball 104
#define null_ball   105
/////////////////////////////////////////num//////////////////////////////////
///Timer_num
#define Timer_receiveball     50
#define Timer_ventball        1500
#define Timer_layball         1500
#define Timer_updatecolor     150
#define Timer_second_ball      3
#define Timer_protect_blueball 250
///Vel_num
#define Vel_receive_ball    2000
#define Vel_divide_ball     8000
#define Vel_trans_ball      5000
#define Vel_lay_ball      (-5500)

typedef struct Divide_ball_yellow_{
    bool is_send_ball                 ;
    bool is_vent_ball                 ;
    bool is_lay_ball                  ;
    bool is_find_ball                 ;
    uint8_t direction                 ;
    uint8_t colour                    ;
}Divide_ball_yellow;

typedef struct Target_ball_ICE_{
    float Target_ball_x    ;
    float Target_ball_y    ;
    float Target_ball_depth;
    float Target_ball_angle;
}Target_ball_ICE;

typedef struct Percept_Pack_{
    Divide_ball_yellow  DivideBall;
    Target_ball_ICE     TargetBall;
}Percept_Pack;

typedef struct Motor_Set_{
    int32_t receive_ball              ;
    int32_t divide_ball               ;
    int32_t trans_ball                ;
    int32_t lay_ball                  ;
}Motor_Set;

typedef struct TimeStamp_{
    uint32_t TimeStamp_is_stop_receive_ball;
    uint32_t TimeStamp_is_vent_ball   ;
    uint32_t TimeStamp_is_lay_ball    ;
    uint32_t TimeStamp_is_update_color;
    uint32_t TimeStamp_is_protect_blueball;
    bool     flag_is_stop_receive_ball;
    bool     flag_is_first_in_lay     ;
    bool     flag_is_protect_blueball ;
    bool     flag_is_update_color     ;
}TimeStamp;

void     Task_Decision();
void     Time_Stamp();
extern   Motor_Set     Motor_Set_param;
extern   Percept_Pack  Percept_RePack;
extern   TimeStamp     Timer_Stamp;

#endif //ENCODER_UPRE_DECISION_H